package org.demo.work;
/**
 * 任务事件
 * @author  
 * @date    2010-10-27
 * @file    org.demo.work.WorkEvent.java
 */
public class WorkEvent {
	
	public static final byte WORK_ACCEPTED = 1;
	public static final byte WORK_STARTED = 2;
	public static final byte WORK_COMPLETED = 3;
	
	// 事件类型
	private byte eventType;
	// 当前任务
	private Work work;
	// 异常信息
	private Exception exception;
	
	/**
	 * 构造函数
	 * @param eventType
	 * @param work
	 * @param exception
	 */
	public WorkEvent(byte eventType, Work work, Exception exception){
		this.eventType = eventType;
		this.work = work;
		this.exception = exception;
	}
	/**
	 * @return the eventType
	 */
	public byte getEventType() {
		return eventType;
	}
	/**
	 * @return the work
	 */
	public Work getWork() {
		return work;
	}
	/**
	 * @return the exception
	 */
	public Exception getException() {
		return exception;
	}
}
